namespace VAdvantage.Model
{

/** Generated Model - DO NOT CHANGE */
using System;
using System.Text;
using VAdvantage.DataBase;
using VAdvantage.Common;
using VAdvantage.Classes;
using VAdvantage.Process;
using VAdvantage.Model;
using VAdvantage.Utility;
using System.Data;
/** Generated Model for M_PackageLine
 *  @author Jagmohan Bhatt (generated) 
 *  @version Vienna Framework 1.1.1 - $Id$ */
public class X_M_PackageLine : PO
{
public X_M_PackageLine (Context ctx, int M_PackageLine_ID, String trxName) : base (ctx, M_PackageLine_ID, trxName)
{
/** if (M_PackageLine_ID == 0)
{
SetM_InOutLine_ID (0);
SetM_PackageLine_ID (0);
SetM_Package_ID (0);
SetQty (0.0);
}
 */
}
public X_M_PackageLine (Ctx ctx, int M_PackageLine_ID, String trxName) : base (ctx, M_PackageLine_ID, trxName)
{
/** if (M_PackageLine_ID == 0)
{
SetM_InOutLine_ID (0);
SetM_PackageLine_ID (0);
SetM_Package_ID (0);
SetQty (0.0);
}
 */
}
/** Load Constructor 
@param ctx context
@param rs result set 
@param trxName transaction
*/
public X_M_PackageLine (Context ctx, DataRow rs, String trxName) : base(ctx, rs, trxName)
{
}
/** Load Constructor 
@param ctx context
@param rs result set 
@param trxName transaction
*/
public X_M_PackageLine (Ctx ctx, DataRow rs, String trxName) : base(ctx, rs, trxName)
{
}
/** Load Constructor 
@param ctx context
@param rs result set 
@param trxName transaction
*/
public X_M_PackageLine (Ctx ctx, IDataReader dr, String trxName) : base(ctx, dr, trxName)
{
}
/** Static Constructor 
 Set Table ID By Table Name
 added by ->Harwinder */
static X_M_PackageLine()
{
 Table_ID = Get_Table_ID(Table_Name);
 model = new KeyNamePair(Table_ID,Table_Name);
}
/** Serial Version No */
static long serialVersionUID = 27562514380321L;
/** Last Updated Timestamp 7/29/2010 1:07:43 PM */
public static long updatedMS = 1280389063532L;
/** AD_Table_ID=663 */
public static int Table_ID;
 // =663;

/** TableName=M_PackageLine */
public static String Table_Name="M_PackageLine";

protected static KeyNamePair model;
protected Decimal accessLevel = new Decimal(1);
/** AccessLevel
@return 1 - Org 
*/
protected override int Get_AccessLevel()
{
return Convert.ToInt32(accessLevel.ToString());
}
/** Load Meta Data
@param ctx context
@return PO Info
*/
protected override POInfo InitPO (Context ctx)
{
POInfo poi = POInfo.GetPOInfo (ctx, Table_ID);
return poi;
}
/** Load Meta Data
@param ctx context
@return PO Info
*/
protected override POInfo InitPO (Ctx ctx)
{
POInfo poi = POInfo.GetPOInfo (ctx, Table_ID);
return poi;
}
/** Info
@return info
*/
public override String ToString()
{
StringBuilder sb = new StringBuilder ("X_M_PackageLine[").Append(Get_ID()).Append("]");
return sb.ToString();
}
/** Set Description.
@param Description Optional short description of the record */
public void SetDescription (String Description)
{
if (Description != null && Description.Length > 255)
{
log.Warning("Length > 255 - truncated");
Description = Description.Substring(0,255);
}
Set_Value ("Description", Description);
}
/** Get Description.
@return Optional short description of the record */
public String GetDescription() 
{
return (String)Get_Value("Description");
}
/** Set Shipment/Receipt Line.
@param M_InOutLine_ID Line on Shipment or Receipt document */
public void SetM_InOutLine_ID (int M_InOutLine_ID)
{
if (M_InOutLine_ID < 1) throw new ArgumentException ("M_InOutLine_ID is mandatory.");
Set_ValueNoCheck ("M_InOutLine_ID", M_InOutLine_ID);
}
/** Get Shipment/Receipt Line.
@return Line on Shipment or Receipt document */
public int GetM_InOutLine_ID() 
{
Object ii = Get_Value("M_InOutLine_ID");
if (ii == null) return 0;
return Convert.ToInt32(ii);
}
/** Set Package Line.
@param M_PackageLine_ID The detail content of the Package */
public void SetM_PackageLine_ID (int M_PackageLine_ID)
{
if (M_PackageLine_ID < 1) throw new ArgumentException ("M_PackageLine_ID is mandatory.");
Set_ValueNoCheck ("M_PackageLine_ID", M_PackageLine_ID);
}
/** Get Package Line.
@return The detail content of the Package */
public int GetM_PackageLine_ID() 
{
Object ii = Get_Value("M_PackageLine_ID");
if (ii == null) return 0;
return Convert.ToInt32(ii);
}
/** Set Package.
@param M_Package_ID Shipment Package */
public void SetM_Package_ID (int M_Package_ID)
{
if (M_Package_ID < 1) throw new ArgumentException ("M_Package_ID is mandatory.");
Set_ValueNoCheck ("M_Package_ID", M_Package_ID);
}
/** Get Package.
@return Shipment Package */
public int GetM_Package_ID() 
{
Object ii = Get_Value("M_Package_ID");
if (ii == null) return 0;
return Convert.ToInt32(ii);
}
/** Get Record ID/ColumnName
@return ID/ColumnName pair */
public KeyNamePair GetKeyNamePair() 
{
return new KeyNamePair(Get_ID(), GetM_Package_ID().ToString());
}
/** Set Quantity.
@param Qty Quantity */
public void SetQty (Decimal? Qty)
{
if (Qty == null) throw new ArgumentException ("Qty is mandatory.");
Set_Value ("Qty", (Decimal?)Qty);
}
/** Get Quantity.
@return Quantity */
public Decimal GetQty() 
{
Object bd =Get_Value("Qty");
if (bd == null) return Env.ZERO;
return  Convert.ToDecimal(bd);
}
}

}
